<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var o = {
            name: 'lizeyan',
        }; 

        function fn(arr){
            console.log(this);
            console.log(arr);
        }

        fn.apply(o,['pink']);
        //1.调用函数，第二个可以改变函数内部的this指向
        //2.参数必须是数组(伪数组)
        //3.apply的主要应用 apply借助于数学内置对象求最大值
        var arr = [111,222,333];
        var max = Math.max.apply(null,arr);
        console.log(max);
        var min = Math.min.apply(null,arr);
        console.log(min);
    </script>
</body>
</html>